package org.tc.shopmall.service;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.tc.shopmall.entity.Orders;
import org.tc.shopmall.entity.PageHelper;

import java.util.List;

@RequestMapping("/OrderService")
public interface OrderService {


    @RequestMapping("/selectAllOrder")
    List<Orders> selectAllOrder( PageHelper pageHelper);

    @PostMapping("/selectCount")
    int selectCount();

    @PostMapping("/updateOrder")
    int updateOrder(Orders orders);

    //查询全部
    @RequestMapping("/selectAllOrders")
    List<Orders> selectAllOrders();

    //根据下单时间查询或者根据下单ID查询
    @RequestMapping("/selectAllDate")
    List<Orders> selectAllDate(@RequestParam("createordertime") String createordertime, @RequestParam("id") Integer id);

    @PostMapping("/insert")
    int insert(@RequestBody Orders record);

    @PostMapping("/deleteByPrimaryKey")
    int deleteByPrimaryKey(@RequestParam("id") Integer id);

    @PostMapping("/selectByPrimaryKey")
    Orders selectByPrimaryKey(@RequestParam("id") Integer id);

    @RequestMapping("/QueryMonth")
    double QueryMonth(@RequestParam("monthtime") String monthtime,
                      @RequestParam("endtime") String endtime,
                      @RequestParam("storeid") Integer storeid);

    @RequestMapping("/QueryDay")
    double QueryDay(@RequestParam("endtime") String endtime,
                    @RequestParam("storeid") Integer storeid);

    @RequestMapping("/QueryDayOrder")
    int QueryDayOrder(@RequestParam("monthtime") String monthtime,
                      @RequestParam("endtime") String endtime,
                      @RequestParam("storeid") Integer storeid);

    @RequestMapping("/QueryRorder")
    int QueryRorder(@RequestParam("endtime") String endtime,
                    @RequestParam("storeid") Integer storeid);

    @RequestMapping("/getOrderLastId")
    int getOrderLastId();

    @RequestMapping("/QueryAllOrders")
    List<Orders> QueryAllOrders(@RequestParam("userid") Integer userid);


}
